class Uniform : public Distribution
{
	public:
	Uniform(){}
	Uniform(int n,int a, int b)
	{
		_n=n;
		boost::random::uniform_int_distribution<>U(a,b);
		runif =new RandomG::Random<boost::random::uniform_int_distribution<> >(U);
		_a=a;
		_b=b;
	}
	virtual ~Uniform()
	{
		delete runif;
	}

	mat r(int j)
	{
		mat X(_n,1);
		for(int i=0;i<_n;i++)
		{
		 	X(i,0)=(*runif)();
		}
		return X;
	}
	mat scrambled(int N)
	{
		mat B(N,_n);
		for(int i=0;i<N;i++)
		{
			B(i,span::all)=(this->r(1)).t();
		}
		return B;
	}


	double 	d(mat x,int i=0,int kk=0){
		if(i==0){
			return -log(_b-_a+1);
		}else{
			return (double)1/(_b-_a+1);
		}
	}
	mat Var(mat X){return arma::cov(X);}
	void Set_n(int n){	_n=n;	}
	void Set_m(mat m){	_m=m;	}
	void Set_s(mat s){	_s=s;}
	mat Get_s(void){return _s;}
	mat Get_m(void){return _m;}
	private:
	int _n;
	mat _m;
	mat _s;
	mat _is;
	mat _cs;
	int _a;
	int _b;
	RandomG::Random<boost::random::uniform_int_distribution<> > *runif;

};

